package com.example.parkdemo.ping

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.create
import retrofit2.http.GET
import retrofit2.http.Query

interface ApiService {
    companion object {
        private const val baseUrl = "https://api.github.com"
        fun create(): ApiService {
            return Retrofit.Builder()
                .baseUrl(baseUrl)
                .addConverterFactory(GsonConverterFactory.create())
                .build().create(ApiService::class.java)
        }
    }

    @GET("/search/repositories?sort=stars&q=Android")
    suspend fun getPagingDate(
        @Query("page") page: Int,
        @Query("per_page") pageSize: Int
    ): DataBeanResult
}